package com.zlc.common.core.position.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zlc.common.common.service.BaseServiceImpl;
import com.zlc.common.core.position.mapper.MayanPlatPositionUserMapper;
import com.zlc.common.core.position.model.entity.MayanPlatPositionUser;
import com.zlc.common.core.position.model.vo.MayanPlatPositionUserVo;
import com.zlc.common.core.position.service.MayanPlatPositionUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author  zl
 * @date 2023-05-08 
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class MayanPlatPositionUserServiceImpl extends BaseServiceImpl<MayanPlatPositionUserMapper, MayanPlatPositionUser, MayanPlatPositionUserVo> implements MayanPlatPositionUserService {

    @Override
    public MayanPlatPositionUserVo getByPositionCodeAndDeptCode(String deptCode, String positionCode, String userAccount) {
        LambdaQueryWrapper<MayanPlatPositionUser> wrapper = wrapper()
                .eq(MayanPlatPositionUser::getPositionCode, positionCode)
                .eq(MayanPlatPositionUser::getDeptCode, deptCode)
                .eq(MayanPlatPositionUser::getUserAccount,userAccount);
        return queryOne(wrapper);
    }
}
